<?php
/**
 * Created by PhpStorm.
 * User: lawrence
 * Date: 10.06.2014
 * Time: 08:23
 */

class Show_Room_Info extends CI_Controller
{
    function get_data()
    {
        $this->load->library('session');

        $data['info']['tabid'] = $this->input->post('tabid');

        $data['info']['startdate'] = $this->input->post('startdate');
        $data['info']['enddate'] = $this->input->post('enddate');
        $data['info']['roomid'] = $this->input->post('roomid');
        $data['info']['location'] = $this->input->post('location');
        $data['info']['floor'] = $this->input->post('floor');
        $data['info']['roomcount'] = $this->input->post('roomcount');
        $data['info']['orientation'] = $this->input->post('orientation');
        $data['info']['aircond'] = $this->input->post('aircond');
        $data['info']['tv'] = $this->input->post('tv');
        $data['info']['minibar'] = $this->input->post('minibar');
        $data['info']['pool'] = $this->input->post('pool');
        $data['info']['jaccuzi'] = $this->input->post('jaccuzi');
        $data['info']['massage'] = $this->input->post('massage');
        $data['info']['haman'] = $this->input->post('haman');
        $data['info']['sauna'] = $this->input->post('sauna');
        $data['info']['salt'] = $this->input->post('salt');
        $data['info']['fitness'] = $this->input->post('fitness');
        $data['info']['steambath'] = $this->input->post('steambath');

        $data['window'] = 'rezervation';
        $data['pagetitle'] = 'Room Info';

        $this->load->view('header', $data);

        $this->load->view('room_info', $data);

        $this->load->view('footer');
    }

    function delete_rezervation()
    {
        $id = $this->input->post('tabid');

        $this->load->model('db_model_find');

        $this->db_model_find->remove_rezervation($id);

        $this->load->library('session');

        $data['result'] = array();

        if($this->session->userdata('logged') == 1)
        {
            $data['window'] = 'rezervation';
            $data['pagetitle'] = 'Rezervations';
            $this->load->view('header', $data);

            $this->load->model('db_model_find');

            $data['result'] = $this->db_model_find->find_user_specific($this->session->userdata('id'));

            $this->load->view('rezervations', $data);

            $this->load->view('footer');
        }
        else
        {
            $data['window'] = 'home';
            $data['pagetitle'] = 'Login';
            $this->load_header($data);

            $this->load->view('login');

            $this->load_footer();
        }
    }
}